package com.ruyuan.eshop.construction.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruyuan.eshop.common.core.PageResult;
import com.ruyuan.eshop.construction.domain.dto.ItemDetailDTO;
import com.ruyuan.eshop.construction.domain.dto.ProducingAreaDTO;
import com.ruyuan.eshop.construction.domain.dto.SkuDetailDTO;
import com.ruyuan.eshop.construction.domain.dto.SkuInfoDTO;
import com.ruyuan.eshop.construction.domain.entity.*;
import com.ruyuan.eshop.construction.domain.request.ProducingAreaRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * 商品相关对象克隆
 * @author zhonghuashishan
 * @version 1.0
 */
@Mapper(componentModel = "spring")
public interface ProductConverter {
    /**
     * 对象克隆
     * @param producingAreaRequest
     * @return
     */
    @Mappings({
            @Mapping(target = "updateUser", source = "operateUser")
    })
    ProducingAreaDO converterDO(ProducingAreaRequest producingAreaRequest);
    /**
     * 对象克隆
     * @param skuInfoDO
     * @return
     */
    SkuPriceUpdateRecordDO converterDO(SkuInfoDO skuInfoDO);

    /**
     * 分页对象克隆
     * @param producingAreaPage
     * @return
     */
    PageResult<ProducingAreaDTO> converterPageResult(Page<ProducingAreaDO> producingAreaPage );
    /**
     * 集合对象克隆
     * @param skuSellerRelationDOList
     * @return
     */
    List<SkuInfoDTO> converterSkuInfoList(List<SkuSellerRelationDO> skuSellerRelationDOList);
    /**
     * 集合对象克隆
     * @param skuDetailList
     * @return
     */
    List<SkuDetailDTO> converterSkuDetailList(List<SkuDetailDO> skuDetailList);

    /**
     * 集合对象克隆
     * @param list
     * @return
     */
    List<ItemDetailDTO> converterItemDetailDOList(List<ItemDetailDO> list);
}
